package com.littleHan.brushQuestions.utils;

import io.jsonwebtoken.Claims;

import javax.servlet.http.HttpServletRequest;

public class GetTokenInfoUtil {

    public static String getUserId(HttpServletRequest request){
        String jwt = request.getHeader("Authorization");
        Claims claims= JwtUtil.parseJWT(jwt);
        return claims.getId();
    }

    public static String getUserId(String jwt){
        Claims claims= JwtUtil.parseJWT(jwt);
        return claims.getId();
    }
}
